Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for c-TPE #208

Merged
merged 1 commit into from
Dec 17, 2024
Merged

Conversation

nabenabe0928
Copy link
Contributor

@nabenabe0928 nabenabe0928 commented Dec 12, 2024

This PR adds unittests for c-TPE.

@HideakiImamura
Copy link
Member

@c-bata Could you review this PR?

Copy link
Member

@c-bata c-bata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirmed that all tests are green. Thank you for your pull request.

$ pytest package/samplers/ctpe/tests/
================================================================================================================================================ test session starts =================================================================================================================================================
platform linux -- Python 3.11.7, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/cbata/go/src/github.com/optuna/optunahub-registry
configfile: pyproject.toml
collected 208 items

package/samplers/ctpe/tests/test_sampler.py ................................................................................................................................................................................................................                                                   [100%]

================================================================================================================================================== warnings summary ==================================================================================================================================================
package/samplers/ctpe/tests/test_sampler.py:772
  /home/cbata/go/src/github.com/optuna/optunahub-registry/package/samplers/ctpe/tests/test_sampler.py:772: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

package/samplers/ctpe/tests/test_sampler.py:800
  /home/cbata/go/src/github.com/optuna/optunahub-registry/package/samplers/ctpe/tests/test_sampler.py:800: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

package/samplers/ctpe/tests/test_sampler.py:868
  /home/cbata/go/src/github.com/optuna/optunahub-registry/package/samplers/ctpe/tests/test_sampler.py:868: PytestUnknownMarkWarning: Unknown pytest.mark.slow - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.slow

package/samplers/ctpe/tests/test_sampler.py: 107 warnings
  /home/cbata/go/src/github.com/optuna/optunahub-registry/venv/lib/python3.11/site-packages/optuna/_experimental.py:31: ExperimentalWarning: Argument ``constraints_func`` is an experimental feature. The interface can change in the future.
    warnings.warn(

package/samplers/ctpe/tests/test_sampler.py: 87 warnings
  /home/cbata/go/src/github.com/optuna/optunahub-registry/venv/lib/python3.11/site-packages/optuna/_experimental.py:31: ExperimentalWarning: Argument ``multivariate`` is an experimental feature. The interface can change in the future.
    warnings.warn(

package/samplers/ctpe/tests/test_sampler.py::test_dynamic_range_objective[20-30-<lambda>0]
  /home/cbata/go/src/github.com/optuna/optunahub-registry/package/samplers/ctpe/sampler.py:188: RuntimeWarning: invalid value encountered in subtract
    log_second_term = np.log(1.0 - _q + _EPS) + lls_above - lls_below

package/samplers/ctpe/tests/test_sampler.py::test_dynamic_range_objective[20-30-<lambda>0]
  /home/cbata/go/src/github.com/optuna/optunahub-registry/package/samplers/ctpe/sampler.py:189: RuntimeWarning: invalid value encountered in logaddexp
    acq_func_vals = np.sum(-np.logaddexp(log_first_term, log_second_term), axis=0)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================================================================================= 208 passed, 199 warnings in 19.00s =========================================================================================================================================

@c-bata c-bata merged commit a267f58 into optuna:main Dec 17, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants